package com.pocket.demo.core.context;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * @author cookie.
 **/
public class RequestIdContext {
    private static InheritableThreadLocal<String> requestIdThreadLocal = new InheritableThreadLocal<>();
    public static final Set<String> CANCEL_DOWNLOAD_IDS = Collections.synchronizedSet(new HashSet<>());

    public static void remove() {
        requestIdThreadLocal.remove();
    }

    public static String getRequestId() {
        return requestIdThreadLocal.get();
    }

    public static void setRequestId(String requestId) {
        /* 20 */     requestIdThreadLocal.set(requestId);
        /*    */   }
}
